﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using ObjectEditor.UserControls;

namespace EQEmu.DatabasePlugin
{
    /// <summary>
    /// Interaction logic for DatabaseLogControl.xaml
    /// </summary>
    public partial class DatabaseLogControl : UserControl, IDynamicTab
    {
        public DatabaseLogControl(DatabaseLogControlViewModel vm)
        {
            InitializeComponent();
            DataContext = vm;
            vm.Update += vm_Update;
        }

        void vm_Update(object sender, DatabaseLogUpdateEventArgs e)
        {
            this.Text.ContentEnd.InsertTextInRun(Environment.NewLine + e.Text);
        }

        public string TabTitle
        {
            get { return "Database"; }
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            this.Text.Inlines.Clear();
        }
    }
}
